<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta charset="UTF-8">
<title>会员信息</title> $!{include("import_js_css.html")}
<script type="text/javascript" src="${assetsPath}/js/easyui/jquery.easyui.min.js"></script>
<link rel="stylesheet" type="text/css" href="${assetsPath}/js/easyui/bootstrap/easyui.css" />
<!--#var(Member member)-->
<script>
	$(function() {
		var swf = $("#pstx EMBED");
		swf.attr("flashvars",swf.attr("flashvars")+"&photoId=${member.memberid}");
		
		$("#pstxBtn").click(function(){
			$("#pstx").dialog("open");
			
		});
		
		var provId = '${provinceId}';
		var cityId = '${cityId}';
		var areaId = '${areaId}';
		var domainId = '${domainId}';
		
		//市区域去掉搜索框
		$("#inputCity").select2({
			width: "100%",
			minimumResultsForSearch: -1
		});
		
		$("#inputArea").select2({
			width: "100%",
			minimumResultsForSearch: -1
		});
		
		$("#inputDomain").select2({
			width: "100%",
			minimumResultsForSearch: -1
		});
		
		$("#inputDomain").select2("val", domainId);
		$("#inputArea").select2("val", areaId);
		$("#inputCity").select2("val", cityId);
		$("#inputProvince").select2("val", provId);
	});
	
	/**
	 * 提供给FLASH的接口 ： 没有摄像头时的回调方法
	 */
	function noCamera() {
		alert("没有摄像头");
	}

	/**
	 * 提供给FLASH的接口：编辑头像保存成功后的回调方法
	 */
	function avatarSaved(data) {
		//这里需跳转到别的页面去
		$("#pstx").dialog("close");
		var basePath = "${basePath}";
		$("#headimg").attr("src", basePath + data);
		$("#headimgpath").val(data);
	}

	/**
	 * 提供给FLASH的接口：编辑头像保存失败的回调方法, msg 是失败信息，
	 * 可以不返回给用户, 仅作调试使用.
	 */
	function avatarError(msg) {
		alert(msg);
	}
</script>
</head>
<body>
	$!{include("header.html")}
	
	
	
	<div class="container" style="width: 1200px;">
		<div class="panel panel-info">
			$!{include("memberHeader.html")}
			<div id="div_result_member" style="padding: 15px;">
				<div class="panel">
					$!{include("member_info_tab.html")}
					<div id="div_result_member" class="panel-hxcd-info">
						<form class="form-horizontal" role="form"
							action="yueyogaAdmin/toEditMemberDetail.jhtml" method="post"
							enctype="multipart/form-data">
							<input type="hidden" id="id" name="id" value="${member.memberid}">
							<table style="font-size: 14px;" width="100%">
								<tr>
								
									<td width="130" valign="top">
										<img alt="" src="${basePath}${member.headimgpath}" id="headimg" height="150" width="124" />
										<button type="button" onclick="$('input[id=lefile]').click();" class="btn btn-success btn-sm" style="margin-top: 5px; width: 124px;">选择头像</button>
										<button id="pstxBtn" type="button" class="btn btn-success btn-sm" style="margin-top: 5px; width: 124px;">拍摄头像</button>
										
										<input type="hidden" id="basePath" value="${basePath}" />
										<input type="hidden" id="headimgpath" name="headimgpath" value="${member.headimgpath}" />
									</td>
									
									<td><label class="col-sm-2 control-label"
										style="width: 100px; color: #4da2d4;"><b>基本信息</b></label> <br />
										<br /> <label for="inputCardnumber"
										class="col-sm-2 control-label" style="width: 100px;">会员卡号</label>
										<div class="col-sm-3">
											<!--#var(Status parentStatu)-->
											<!-- #if(parentStatu.name=="正式会员") -->
											<input type="text" class="form-control panel-text-bg"
												name="cardNumber" id="inputCardnumber" required
												value="${member.cardnumber}">
											<!-- #else -->
											<input type="text" class="form-control panel-text-bg"
												name="cardNumber" id="inputCardnumber" readonly required
												value="${member.cardnumber}">
											<!-- #end -->
										</div> <label for="inputPhone" class="col-sm-1 control-label"
										style="width: 100px;"><font color="red">*</font>手机号</label>
										<div class="col-sm-3">
											<input type="text" class="form-control" name="phone"
												id="inputPhone" required placeholder="手机号"
												value="${member.phone}">
										</div>
										<br /> <br />
										<label for="inputName" class="col-sm-2 control-label"  style="width:100px;"><font color="red">*</font>会员姓名</label>
										<div class="col-sm-3">
											<input type="text" class="form-control" name="name"
												id="inputName" value="${member.name}" required>
										</div>
										
										<!-- 卡外编码 -->
										<label for="outsideCardNo" class="col-sm-1 control-label" style="width: 100px;">卡外码</label>
										<div class="col-sm-3">
											<input type="text" class="form-control" name="outsideCardNo"
												id="outsideCardNo" value="${member.outsideCardNo}">
										</div>
										
										
										 <br /> <br /> <label for="inputNameEn"
										class="col-sm-2 control-label" style="width: 100px;">英文名</label>
										<div class="col-sm-3">
											<input type="text" class="form-control" name="nameEn"
												value="${member.nameEn}" id="inputNameEn">
										</div> <label for="inputEmail" class="col-sm-1 control-label"
										style="width: 100px;">会员邮箱</label>
										<div class="col-sm-3">
											<input type="email" class="form-control" name="email"
												id="inputEmail" value="${member.email}">
										</div> <br /> <br /> <label for="inputSex"
										class="col-sm-2 control-label" style="width: 100px;">会员性别</label>
										<div class="col-sm-3">
											<label class="radio-inline"> <!--#if(member.sex==null || member.sex=='男')-->
												<input type="radio" name="sex" value="男" checked="checked">男
												<!--#else--> <input type="radio" name="sex" value="男">男
												<!--#end-->
											</label> <label class="radio-inline"> <!--#if(member.sex=='女')-->
												<input type="radio" name="sex" value="女" checked="checked">女
												<!--#else--> <input type="radio" name="sex" value="女">女
												<!--#end-->
											</label>
										</div> <label for="inputQQ" class="col-sm-1 control-label"
										style="width: 100px;">会员QQ</label>
										<div class="col-sm-3">
											<input type="text" class="form-control" name="QQ"
												id="inputQQ" value="${member.qq}">
										</div> <br /> <br /> <br /> <label for="inputBirthday"
										class="col-sm-2 control-label" style="width: 100px;">出生日期</label>
										<div class="col-sm-2">
											<div class='input-group date' id='inputBirthday'
												data-date-format="YYYY-MM-DD">
												<input name="birthday" id="birthday" type='text'
													class="form-control" style="background-color: #fff;"
													value="${member.birthday.format('yyyy-MM-dd')}" /> <span
													class="input-group-addon"><span
													class="glyphicon glyphicon-time"></span></span>
											</div>
										</div> <label class="col-sm-1" id="lb_birthday"
										style="text-align: left; top: 7px; padding: 0px; font-weight: 100;">年龄：${nianling}</label>

										<label for="inputWechat" class="col-sm-1 control-label"
										style="width: 100px;">会员微信</label>
										<div class="col-sm-3">
											<input type="text" class="form-control" name="wechat"
												id="inputWechat" value="${member.wechat}">
										</div> <br /> <br /> <label for="hallcode"
										class="col-sm-2 control-label" style="width: 100px;">所在会馆</label>
										<div class="col-sm-3">
											<!--#var(Hall memberHall)-->
											<div
												style="width: 100%; height: 35px; text-align: left; line-height: 35px;">
												<input type="text" class="form-control panel-text-bg"
													readonly value="${memberHall.name}" />
											</div>
										</div> 
										
										<label for="txtHomeNumber" class="col-sm-1 control-label" style="width: 100px;">家庭电话</label>
										<div class="col-sm-3">
											<input type="text" class="form-control" name="homeNumber"
												id="txtHomeNumber" value="${member.homeNumber}">
										</div>
										
										
										
										 <br /> <br />
										
										 <!-- #if(parentStatu.name=="正式会员") --> <label
										for="inputMemberLevel" class="col-sm-2 control-label clear"
										style="width: 100px;">会员等级</label>
										<div class="col-sm-3">
											<!--#var(MemberLevel memberLevel, List<MemberLevel> memberLevels)-->
											<select id="inputMemberLevel" class="selectpicker show-tick"
												data-width="100%" name="inputMemberLevel">
												<!--#foreach(memberLevel in memberLevels)-->
												<option value="${memberLevel.memberLevelId}">${memberLevel.levelName}</option>
												<!-- #end -->
											</select>
										</div>
										
										<label for="inputTime" class="col-sm-2 control-label" style="width: 100px;">创建时间</label>
										<div class="col-sm-3">
											<div
												style="width: 100%; height: 35px; text-align: left; line-height: 35px;">
												<input type="text" class="form-control panel-text-bg"
													readonly value="${member.inputTime}" />
											</div>
										</div>
										
										 <!-- #end --></td>
								</tr>
								<tr></tr>
							</table>
							<br />
							<hr class="divider" />
							<br />
							<table class="table table-bordered table-hover table-condensed"
								style="text-align: center; font-size: 14px; margin-bottom: 0; width: 635px; margin-left: 166px; border-radius: 4px !important;">
								<tr style="background: #F4F4F4;">
									<td>名称</td>
									<td width="120px">状态</td>
									<td width="160px">操作时间</td>
									<td width="160px">操作</td>
								</tr>
								<tr>
									<td>是否参加专题讲座</td>
									<td id="trialClass">
										<!--#if(member.earlyExperience.trialclass)--> <img alt=""
										src="${basePath}app/admin/resources/images/dui.jpg"> <!--#end-->
									</td>
									<td id="trialClassTime">
										<!--#if(member.earlyExperience.trialclass)-->
										${member.earlyExperience.trialclassTime.toDate("yyyy-MM-dd HH:mm:ss")} 
										<!--#end-->
									</td>
									<td><label class="radio-line"> <!--#if(member.earlyExperience.trialclass)-->
											<input type="radio" name="trialclass" checked="checked"
											value="true"
											onclick="chengEarlyExperience('trialClass','true');" />是
									</label> <label class="radio-line"> <input type="radio"
											name="trialclass" value="false"
											onclick="chengEarlyExperience('trialClass','false');" />否 <!--#else-->
											<input type="radio" name="trialclass" value="true"
											onclick="chengEarlyExperience('trialClass','true');" />是
									</label> <label class="radio-line"> <input type="radio"
											name="trialclass" checked="checked" value="false"
											onclick="chengEarlyExperience('trialClass','false');" />否 <!--#end-->
									</label></td>
								</tr>
								<tr>
									<td>是否参加体验课</td>
									<td id="demoClass">
										<!--#if(member.earlyExperience.democlass)--> <img alt=""
										src="${basePath}app/admin/resources/images/dui.jpg"> <!--#end-->
									</td>
									<td id="demoClassTime">
										<!--#if(member.earlyExperience.democlass)-->
										${member.earlyExperience.democlassTime.toDate("yyyy-MM-dd HH:mm:ss")} <!--#end-->
									</td>
									<td><label class="radio-line"> <!--#if(member.earlyExperience.democlass)-->
											<input type="radio" name="democlass" checked="checked"
											value="true"
											onclick="chengEarlyExperience('demoClass','true');" />是
									</label> <label class="radio-line"> <input type="radio"
											name="democlass" value="false"
											onclick="chengEarlyExperience('demoClass','false');" />否 <!--#else-->
											<input type="radio" name="democlass" value="true"
											onclick="chengEarlyExperience('demoClass','true');" />是
									</label> <label class="radio-line"> <input type="radio"
											name="democlass" checked="checked" value="false"
											onclick="chengEarlyExperience('demoClass','false');" />否 <!--#end-->
									</label></td>
								</tr>
								<tr>
									<td>是否进行体能测试</td>
									<td id="placementTest">
										<!--#if(member.earlyExperience.placementtest)--> <img alt=""
										src="${basePath}app/admin/resources/images/dui.jpg"> <!--#end-->
									</td>
									<td id="placementTestTime">
										<!--#if(member.earlyExperience.placementtest)-->
										${member.earlyExperience.placementtestTime.toDate("yyyy-MM-dd HH:mm:ss")} <!--#end-->
									</td>
									<td><label class="radio-line"> <!--#if(member.earlyExperience.placementtest)-->
											<input type="radio" name="placementtest" checked="checked"
											value="true"
											onclick="chengEarlyExperience('placementTest','true');" />是
									</label> <label class="radio-line"> <input type="radio"
											name="placementtest" value="false"
											onclick="chengEarlyExperience('placementTest','false');" />否
											<!--#else--> <input type="radio" name="placementtest"
											value="true"
											onclick="chengEarlyExperience('placementTest','true');" />是
									</label> <label class="radio-line"> <input type="radio"
											name="placementtest" checked="checked" value="false"
											onclick="chengEarlyExperience('placementTest','false');" />否
											<!--#end-->
									</label></td>
								</tr>
								<tr>
									<td>是否到访</td>
									<td id="visit">
										<!--#if(member.earlyExperience.visit)--> <img alt=""
										src="${basePath}app/admin/resources/images/dui.jpg"> <!--#end-->
									</td>
									<td id="visitTime">
										<!--#if(member.earlyExperience.visit)-->
										${member.earlyExperience.visitTime.toDate("yyyy-MM-dd HH:mm:ss")} <!--#end-->
									</td>
									<td align="center"><label class="radio-line"> <!--#if(member.earlyExperience.visit)-->
											<input type="radio" name="visit" checked="checked"
											value="true" onclick="chengEarlyExperience('visit','true');" />是
									</label> <label class="radio-line"> <input type="radio"
											name="visit" value="false"
											onclick="chengEarlyExperience('visit','false');" />否 <!--#else-->
											<input type="radio" name="visit" value="true"
											onclick="chengEarlyExperience('visit','true');" />是
									</label> <label class="radio-line"> <input type="radio"
											name="visit" checked="checked" value="false"
											onclick="chengEarlyExperience('visit','false');" />否 <!--#end-->
									</label></td>
								</tr>
							</table>
							<br />
							<hr class="divider" />
							<table style="font-size: 14px;" width="100%">
								<tr>
									<td width="130" valign="top">&nbsp;</td>
									<td><label class="col-sm-1 control-label"
										style="color: #4da2d4;"><b>地址信息</b></label> <br /> <br /> <label
										for="inputProvince" class="col-sm-1 control-label">所在省</label>
										<div class="col-sm-3">
											<!--#var(Area area,List<Area> provinces, List<Area> citys, List<Area> areas, List<Area> domains)-->
											<select id="inputProvince" data-live-search="true"
												class="selectpicker show-tick" data-width="100%"
												name="inputProvince">
												<option value=""> </option>
												<!--#foreach(area in provinces)-->
												<option value="${area.areaId}">${area.name}</option>
												<!-- #end -->
											</select>
										</div> <label for="inputCity" class="col-sm-1 control-label">所在市</label>
										<div class="col-sm-3">
											<!-- #var(Area provinceArea) -->
											<select id="inputCity" data-live-search="true"
												class="selectpicker show-tick" data-width="100%"
												name="inputCity">
												<option value=""> </option>
												<!--#foreach(area in citys)-->
												<option value="${area.areaId}">${area.name}</option>
												<!-- #end -->
											</select>
										</div> <br /> <br /> <label for="inputArea"
										class="col-sm-1 control-label">所在区</label>
										<div class="col-sm-3">
											<!-- #var(Area cityArea) -->
											<select id="inputArea" data-live-search="true"
												class="selectpicker show-tick" data-width="100%"
												name="inputArea">
												<option value=""> </option>
												<!--#foreach(area in areas)-->
												<option value="${area.areaId}">${area.name}</option>
												<!-- #end -->
											</select>
										</div> <label for="inputDomain  input-default"
										class="col-sm-1 control-label">所在域</label>
										<div class="col-sm-3">
											<!-- #var(Area parentArea) -->
											<select id="inputDomain" data-live-search="true"
												class="selectpicker show-tick" data-width="100%"
												name="domainId">
												<option value=""> </option>
												<!--#foreach(area in domains)-->
												<option value="${area.areaId}">${area.name}</option>
												<!-- #end -->
											</select>
										</div> <br /> <br /> <br /> <label for="inputAddress"
										class="col-sm-1 control-label">具体地址</label>
										<div class="col-sm-7">
											<input type="text" style="width: 557px" class="form-control"
												name="address" id="inputAddress" value="${member.address}">
										</div> <br /> <br /> <label for="inputCompanyAddress"
										class="col-sm-1 control-label">公司地址</label>
										<div class="col-sm-7">
											<input type="text" style="width: 557px" class="form-control"
												name="companyAddress" id="inputCompanyAddress"
												value="${member.companyaddress}">
										</div> <br /> <br /> <label for="inputCompany"
										class="col-sm-1 control-label">工作单位</label>
										<div class="col-sm-7">
											<input type="text" style="width: 557px" class="form-control"
												name="company" id="inputCompany" value="${member.company}">
										</div></td>
								</tr>
							</table>
							<br />
							<hr class="divider" />
							<table style="font-size: 14px;" width="100%">
								<tr>
									<td width="130" valign="top">&nbsp;</td>
									<td><label class="col-sm-1 control-label"
										style="color: #4da2d4;"><b>附加信息</b></label> <br /> <br /> <!--#var(Status parentStatu)-->
										<!--#var(Status statu)--> <label for="memberStatus"
										class="col-sm-1 control-label">会员状态</label>
										<div class="col-sm-3">
											<!--#var(Status status, List<Status> memberStatus,List<Status> subStatuses)-->
											<select id="memberStatus" class="selectpicker show-tick"
												data-width="100%" name="memberStatus">
												<option value=""> </option>
												<!-- #foreach(status in memberStatus) -->
												<!-- #if(status.code==parentStatu.code) -->
												<option value="${status.code}" selected="selected">${status.name}</option>
												<!-- #else -->
												<option value="${status.code}">${status.name}</option>
												<!-- #end -->
												<!-- #end -->
											</select>
										</div><input type="hidden" id="hidHyzt" value="${parentStatu.code}" />
										<input type="hidden" id="hidHyzzt" value="${statu.code}" /> <label
										for="memberSubStatus" class="col-sm-1 control-label">子状态</label>
										<div class="col-sm-3">
											<select id="memberSubStatus" class="selectpicker show-tick"
												data-width="100%" name="memberSubStatus">
												<option value=""> </option>
												<!-- #foreach(status in subStatuses) -->
												<!-- #if(status.code==statu.code) -->
												<option value="${status.code}" selected="selected">${status.name}</option>
												<!-- #else -->
												<option value="${status.code}">${status.name}</option>
												<!-- #end -->
												<!-- #end -->
											</select>
										</div> </br>
									</br> <!-- 隐藏的子状态 -->
										<div id="zzt" class="panel-dialog-box" style="width:430px !important;min-height: 250px !important;display:none; z-index: 10;">
											<div class="panel-heading panel-result-title">
												<h3 class="panel-title">状态设置</h3>
											</div>
											<br>
											<label for="memberStatus2" class="col-sm-1 control-label">会员状态</label>
											<div class="col-sm-7">
												<!--#var(Status status, List<Status> memberStatus,List<Status> subStatuses)-->
												<select id="memberStatus2" class="selectpicker show-tick"
													data-width="100%" name="memberStatus">
													<option value=""> </option>
													<!-- #foreach(status in memberStatus) -->
													<option value="${status.code}" >${status.name}</option>
													<!-- #end -->
												</select>
											</div>
											<br><br>
											 <input type="hidden" id="hidHyzt2"
												value="${parentStatu.code}" /> <input type="hidden"
												id="hidHyzzt2" value="${statu.code}" /> <label
												for="memberSubStatus2" class="col-sm-1 control-label">子状态</label>
											<div class="col-sm-7">
												<select id="memberSubStatus2" class="selectpicker show-tick"
													data-width="100%" name="memberSubStatus2">
													<option value=""> </option>
													<!-- #foreach(status2 in subStatuses) -->
													<option value="${status2.code}">${status2.name}</option>
													<!-- #end -->
												</select>
											</div>
											<br>
											<br>
											<div style="width:200px;float:right;margin-right:94px;margin-top:30px;">
											<button type="button" style="margin-left:20px;"
												class="btn btn-default btn-ade-default" onclick="qxzzt()">取消</button>
											<button  type="button"
												class="btn btn-default btn-ade-default" onclick="ok()">确定</button>
											</div>
										</div> <label for="inputRemarks" class="col-sm-1 control-label">会员备注</label>
										<div class="col-sm-7">
											<textarea class="form-control noneResize"
												style="width: 557px" name="remarks" id="inputRemarks"
												rows="3">${member.remarks}</textarea>
										</div> <br /> <br />
									<br />
									<br />
									<br />
										<div class="col-sm-7"></div>
										<div class="panel-btn-add">
											<button type="submit" class="btn btn-default btn-ade-default">保存</button>
										</div></td>
								</tr>
							</table>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<div id="pstx" class="easyui-dialog" style="width:550px;height:520px;" data-options="title:'拍摄头像',closed:true">
		<EMBED height="464" type="application/x-shockwave-flash"
			pluginspage="http://www.macromedia.com/go/getflashplayer" width="514"
			src="${assetsPath}/flash/AvatarEditor.swf" quality="high" allowscriptaccess="always"
			flashvars="type=camera&amp;postUrl=yueyogaAdmin/AvatarServlet?&amp;radom=1&amp;saveUrl=yueyogaAdmin/AvatarServlet?radom=1">
		</EMBED>
	</div>
	
	<form role="form" id="uploadImg" target="upload" name="uploadImg"
		action="yueyogaAdmin/toUpdateMemberHeadImg.jhtml" method="post"
		enctype="multipart/form-data">
		<input id="lefile" name="headImgPath" type="file" style="display: none;" onChange="uploadHeadImg()">
	</form>
	<iframe name="upload" id="upload" style="display: none"> </iframe>
	
	<script type="text/javascript">
		var a = 0;
		function qxzzt() {
			$("#zzt").hide();
		}
		function ok() {
			$("#zzt").hide();
			var bb = $("#memberStatus2").select2("val");
			var aa = $("#memberSubStatus2").select2("val");
			$("#memberStatus").select2("val", bb);
			$("#memberSubStatus").select2("val", aa);
			a = 1;
		}
		function no() {

		}
		$(function() {
			var msg = "${msg}";
			if (msg != null && msg != "") {
				var d = wait(msg);
			}
			$("#inputBirthday").datetimepicker({
				language : "zh-CN",
				pickTime : false
			});
			
			//去掉下拉输入框
			$("#memberStatus").select2({
				width: "100%",
				minimumResultsForSearch: -1
			});
			
			$("#memberStatus2").select2({
				width: "100%",
				minimumResultsForSearch: -1
			});
			
			$("#memberSubStatus").select2({
				width: "100%",
				minimumResultsForSearch: -1
			});
			
			$("#memberSubStatus2").select2({
				width: "100%",
				minimumResultsForSearch: -1
			});
			
			//会员状态
			$("#memberStatus").change(function() {
				var value = $(this).select2("val");
				if (value == null || value == '') {
					var sub = document.getElementById("memberSubStatus");
					sub.options.length = 0;
					sub.options.add(new Option(" ", ""));
					return;
				}
				$.post("yueyogaAdmin/substatus.jhtml", {
					"code" : value
				}, function(response) {
					var res = eval("(" + response + ")");
					if (res.success) {
						var option = null;
						var code = null;
						var name = null;
						var sub = document.getElementById("memberSubStatus");
						sub.options.length = 0;
						option = new Option(" ", "");
						sub.options.add(option);
						for ( var i = 0; i < res.items.length; i++) {
							code = res.items[i].code;
							name = res.items[i].name;
							option = new Option(name, code);
							sub.options.add(option);
						}
					} else {
						alert(res.msg);
					}
				});
			});
			
			//隐藏会员状态
			$("#memberStatus2").change(function() {
				var value = $(this).select2("val");
				if (value == null || value == '') {
					var sub2 = document.getElementById("memberSubStatus2");
					var sub = document.getElementById("memberSubStatus");
					sub2.options.length = 0;
					sub2.options.add(new Option(" ", ""));
					sub.options.length = 0;
					sub.options.add(new Option(" ", ""));
					return;
				}
				$.post("yueyogaAdmin/substatus.jhtml", {
					"code" : value
				}, function(response) {
					var res = eval("(" + response + ")");
					if (res.success) {
						var option = null;
						var option1 = null;
						var code = null;
						var name = null;
						var sub2 = document.getElementById("memberSubStatus2");
						var sub = document.getElementById("memberSubStatus");
						sub2.options.length = 0;
						sub.options.length = 0;
						option = new Option(" ", "");
						sub2.options.add(option);
						sub.options.add(option);
						for ( var i = 0; i < res.items.length; i++) {
							code = res.items[i].code;
							name = res.items[i].name;
							option = new Option(name, code);
							option1 = new Option(name, code);
							sub2.options.add(option);
							sub.options.add(option1);
						}
					} else {
						alert(res.msg);
					}
				});
			});
		});
		function uploadHeadImg() {
			var form = $("#uploadImg");
			var lefile = $("#lefile").val();
			if (lefile != null && lefile != "") {
				form.submit();
			}
		}
		function updateHeadImg(src) {
			var basePath = $("#basePath").val();
			$("#headimg").attr("src", basePath + src);
			$("#headimgpath").val(src);
		}
		//省
		$("#inputProvince").change(function() {
			var parentId = $(this).select2("val");
			if (parentId == null || parentId == '') {
				var sub = document.getElementById("inputCity");
				sub.options.length = 0;
				option = new Option("请选择市", "");
				sub.options.add(option);
				var sub1 = document.getElementById("inputArea");
				sub1.options.length = 0;
				option = new Option("请选择区", "");
				sub1.options.add(option);
				var sub2 = document.getElementById("inputDomain");
				sub2.options.length = 0;
				option = new Option("请选择域", "");
				sub2.options.add(option);
				return;
			}
			$.post("yueyogaAdmin/subArea.jhtml", {
				"level" : "1",
				"parentId" : parentId
			}, function(response) {
				var sub = document.getElementById("inputCity");
				var res = eval("(" + response + ")");
				var id = null;
				var name = null;
				var option = null;
				sub.options.length = 0;
				option = new Option("请选择市", "");
				sub.options.add(option);
				for ( var i = 0; i < res.items.length; i++) {
					id = res.items[i].areaId;
					name = res.items[i].name;
					option = new Option(name, id);
					sub.options.add(option);
				}
				var sub1 = document.getElementById("inputArea");
				sub1.options.length = 0;
				option = new Option("请选择区", "");
				sub1.options.add(option);
				var sub2 = document.getElementById("inputDomain");
				sub2.options.length = 0;
				option = new Option("请选择域", "");
				sub2.options.add(option);
			});
		});

		//市
		$("#inputCity").change(function() {
			var parentId = $(this).select2("val");
			if (parentId == null || parentId == '') {
				var sub1 = document.getElementById("inputArea");
				sub1.options.length = 0;
				option = new Option("请选择区", "");
				sub1.options.add(option);
				var sub2 = document.getElementById("inputDomain");
				sub2.options.length = 0;
				option = new Option("请选择域", "");
				sub2.options.add(option);
				return;
			}
			$.post("yueyogaAdmin/subArea.jhtml", {
				"level" : "2",
				"parentId" : parentId
			}, function(response) {
				var sub = document.getElementById("inputArea");
				var res = eval("(" + response + ")");
				var id = null;
				var name = null;
				var option = null;
				sub.options.length = 0;
				option = new Option("请选择区", "");
				sub.options.add(option);
				for ( var i = 0; i < res.items.length; i++) {
					id = res.items[i].areaId;
					name = res.items[i].name;
					option = new Option(name, id);
					sub.options.add(option);
				}
				var sub1 = document.getElementById("inputDomain");
				sub1.options.length = 0;
				option = new Option("请选择域", "");
				sub1.options.add(option);
			});
		});

		//区
		$("#inputArea").change(function() {
			var parentId = $(this).select2("val");
			if (parentId == null || parentId == '') {
				var sub2 = document.getElementById("inputDomain");
				sub2.options.length = 0;
				option = new Option("请选择域", "");
				sub2.options.add(option);
				return;
			}
			$.post("yueyogaAdmin/subArea.jhtml", {
				"level" : "3",
				"parentId" : parentId
			}, function(response) {
				var sub = document.getElementById("inputDomain");
				var res = eval("(" + response + ")");
				var id = null;
				var name = null;
				var option = null;
				sub.options.length = 0;
				option = new Option("请选择域", "");
				sub.options.add(option);
				for ( var i = 0; i < res.items.length; i++) {
					id = res.items[i].areaId;
					name = res.items[i].name;
					option = new Option(name, id);
					sub.options.add(option);
				}
			});
		});
		function chengEarlyExperience(column, value) {
			var id = $("#id").val();
			var column1 = column;
			var column2 = column + "Time";
			var url = "yueyogaAdmin/updateEarlyExperience.jhtml";
			$.post(url,{
								id : id,
								column1 : column1,
								column2 : column2,
								value : value
							},
							function(response) {
								if (response.success) {
									if (value == "true") {
										$("#" + column).html("<img src=\"${basePath}/app/admin/resources/images/dui.jpg\">");
										$("#" + column2).html(response.val);
										var memberStatus = $("#memberStatus").val();
										if (memberStatus == ''|| memberStatus == "0001" || memberStatus == "0002") {
											$("#zzt").show();
											$("#memberStatus2").val("0002");
											$("#memberStatus").val("0002");
											$.post("yueyogaAdmin/substatus.jhtml",
															{
																"code" : "0002"
															},
															function(response) {
																var res = eval("("+ response + ")");
																if (res.success) {
																	var option = null;
																	var code = null;
																	var name = null;
																	var sub = document.getElementById("memberSubStatus");
																	var sub2 = document.getElementById("memberSubStatus2");
																	sub.options.length = 0;
																	sub2.options.length = 0;
																	option = new Option(" ","");
																	option1= new Option(" ","")
																	sub.options.add(option);
																	sub2.options.add(option1);
																	for ( var i = 0; i < res.items.length; i++) {
																		code = res.items[i].code;
																		name = res.items[i].name;
																		option = new Option(name,code);
																		option1 = new Option(name,code);
																		sub.options.add(option);
																		sub2.options.add(option1);
																	}
																	$("#memberSubStatus2").val(" ");
																	$("#memberSubStatus").val(" ");
																} else {
																	alert(res.msg);
																}
															});
										}
									} else {
										$("#zzt").hide();
										$("#" + column).html("");
										$("#" + column2).html("");
										var hyzt = $("#hidHyzt2").val();
										var hyzzt = $("#hidHyzzt2").val();
										$("#memberStatus").val(hyzt);
										$("#memberSubStatus").val(hyzzt);
									}
								} else {
									alert(response.val);
								}
							}, "json");
		}
		$("#inputMemberLevel").select2('val', '${member.levelId}');

		$("#birthday").bind(
						"propertychange input",
						function() {
							var birthday = $("#birthday").val();
							if (birthday.length >= 10) {
								birthday = new Date(birthday
										.replace(/-/g, "\/"));
								var d = new Date();
								var age = d.getFullYear()
										- birthday.getFullYear()
										- ((d.getMonth() < birthday.getMonth() || d
												.getMonth() == birthday
												.getMonth()
												&& d.getDate() < birthday
														.getDate()) ? 1 : 0);
								var str = "年龄：";
								$("#lb_birthday").text(str + age);
								$("#birthday").focus();
							}
						});
	</script>
</body>
</html>